package com.ys.web.pay.model;

import com.ys.utils.base.j2se.Convert;
import com.ys.utils.base.j2se.StringHandler;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class RedPacket {
    public long id;
    public long uid;
    /** 钱包id */
    public String walletId;
    /** 订单号 */
    public String orderSn;
    /** 红包类型 */
    public String packetType;
    /** 单笔金额 */
    public String singleAmount;
    /** 总金额 */
    public String amount;
    /** 红包数量 */
    public int packetCount;
    /** 订单状态 */
    public String orderStatus;
    /** 交易流水号 */
    public String serialNumber;
    /** 接收类型 1私聊 2群聊 */
    public String gp;
    /** 接收id */
    public String receivedId;
    /** 接收用户ids，逗号分隔 */
    public String receivedIds;
    /** 完成时间 */
    public String createDateTime;
    /** 支付时间 */
    public String debitDateTime;
    /** 完成时间 */
    public String completeDateTime;
    /** 订单错误信：只有转账状态出现异常时返回此参数 */
    public String orderErrorMessage;

    /** 支付方式 */
    public String paymentType ;
    /** 卡号 */
    public String bankCardNumber;
    /** 银行代码 */
    public String bankCode;
    /** 银行名称 */
    public String bankName;
    /** 接收红包个数 */
    public int receivedCount;
    /** 接收红包金额 */
    public String receivedAmount;

    public String remark;

    public Integer dateKey;
    public Integer monthKey;

    public String messageId;


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getUid() {
        return uid;
    }

    public void setUid(long uid) {
        this.uid = uid;
    }

    public String getWalletId() {
        return walletId;
    }

    public void setWalletId(String walletId) {
        this.walletId = walletId;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public String getPacketType() {
        return packetType;
    }

    public void setPacketType(String packetType) {
        this.packetType = packetType;
    }

    public String getSingleAmount() {
        return singleAmount;
    }

    public void setSingleAmount(String singleAmount) {
        this.singleAmount = singleAmount;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public int getPacketCount() {
        return packetCount;
    }

    public void setPacketCount(int packetCount) {
        this.packetCount = packetCount;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getGp() {
        return gp;
    }

    public void setGp(String gp) {
        this.gp = gp;
    }

    public String getReceivedId() {
        return receivedId;
    }

    public void setReceivedId(String receivedId) {
        this.receivedId = receivedId;
    }

    public String getReceivedIds() {
        return receivedIds;
    }

    public void setReceivedIds(String receivedIds) {
        this.receivedIds = receivedIds;
    }

    public String getCreateDateTime() {
        return createDateTime;
    }

    public void setCreateDateTime(String createDateTime) {
        this.createDateTime = createDateTime;
    }

    public String getDebitDateTime() {
        return debitDateTime;
    }

    public void setDebitDateTime(String debitDateTime) {
        this.debitDateTime = debitDateTime;
    }

    public String getCompleteDateTime() {
        return completeDateTime;
    }

    public void setCompleteDateTime(String completeDateTime) {
        this.completeDateTime = completeDateTime;
    }

    public String getOrderErrorMessage() {
        return orderErrorMessage;
    }

    public void setOrderErrorMessage(String orderErrorMessage) {
        this.orderErrorMessage = orderErrorMessage;
    }

    public String getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(String paymentType) {
        this.paymentType = paymentType;
    }

    public String getBankCardNumber() {
        return bankCardNumber;
    }

    public void setBankCardNumber(String bankCardNumber) {
        this.bankCardNumber = bankCardNumber;
    }

    public String getBankCode() {
        return bankCode;
    }

    public void setBankCode(String bankCode) {
        this.bankCode = bankCode;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public int getReceivedCount() {
        return receivedCount;
    }

    public void setReceivedCount(int receivedCount) {
        this.receivedCount = receivedCount;
    }

    public String getReceivedAmount() {
        return receivedAmount;
    }

    public void setReceivedAmount(String receivedAmount) {
        this.receivedAmount = receivedAmount;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getDateKey() {
        return dateKey;
    }

    public void setDateKey(Integer dateKey) {
        this.dateKey = dateKey;
    }

    public Integer getMonthKey() {
        return monthKey;
    }

    public void setMonthKey(Integer monthKey) {
        this.monthKey = monthKey;
    }

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getRedAmount(){
        return StringHandler.moneyDesc(this.packetType.equals("GROUP_LUCK")? StringHandler.getLong(this.amount):StringHandler.getLong(this.singleAmount));
    }
}
